package com.tcse.ppmethodhandler.entity;

import java.util.Map;

/**
 * @author aozeliu
 */
public class HttpInfo {

    private String method;
    private String uri;
    private Map<String, String> headers;
    
    public HttpInfo() { }
    
    public HttpInfo(String uri) {
        this.uri = uri;
    }

    public HttpInfo(String method, String uri, Map<String, String> headers) {
        this.method = method;
        this.uri = uri;
        this.headers = headers;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }


    public String getMethod() {
        return method;
    }

    public String getUri() {
        return uri;
    }

    public static HttpInfo build(String url){
        return new HttpInfo(url);
    }
    
    public String toString(){
        String headerString = headers==null?"null ": headers.toString();
        return "HttpInfo{" + "method: '" + method + "' " + "uri: '" + uri + "' " + "headers: '" + headerString + "'";
    }
}
